package com.lfx.concurrent;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.function.Supplier;

public class CompletTableFutureMain2 {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        CompletableFuture<String> stringCompletableFuture1 = CompletableFuture.supplyAsync(() -> {
            return "返回结果";
        });

        String result = stringCompletableFuture1.get();
        System.out.println("result"+result);

    }
}
